﻿using System;
using System.Collections.ObjectModel;
using System.Windows.Threading;

using Xc.DataAccess.Core;
using Xc.DataAccess.HyperTerminalCore.Models;

namespace Xc.DataAccess.HyperTerminalCore.Services
{
    public interface ITcpServerService: IDeviceService<TcpServerOption>
    {
        /// <summary>
        /// 当客户端接入时触发
        /// </summary>
        event Action<TcpClientInfo> OnClientJoin;
        /// <summary>
        /// 当客户端断开时触发
        /// </summary>
        event Action<TcpClientInfo> OnClientCloing;

        ObservableCollection<TcpClientInfo> TcpClients { get; set; }
        /// <summary>
        /// 配置信息
        /// </summary>
        TcpServerOption Option { get; set; }
        /// <summary>
        /// 指定要调用的线程分发器
        /// </summary>
        Dispatcher Dispatcher { get; set; }
    }
}